﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Driverplugin;
using Grpc.Core;
using Grpc.Net.Client;

namespace IoTEdge.Grpc.Server.AMR.service
{
    public class amrhelp
    {
        Metadata meta = new Metadata();
        DriverPlugin.DriverPluginClient client = new DriverPlugin.DriverPluginClient(GrpcChannel.ForAddress("192.168.1.182:8090"));
        public amrhelp()
        {
            meta.Add("token", "123456");
        }
        #region MyRegion
        public async void dodunc1()
        {
            AsyncDuplexStreamingCall<Data, Response> trasdata = client.TransformData(meta, DateTime.Now, CancellationToken.None);
            var lifectr = client.DeviceLifeControl(meta);

            var liferesstream = lifectr.ResponseStream;





            var resstream = trasdata.ResponseStream;

            while (await resstream.MoveNext())
            {
                var res1 = resstream.Current;
            }
        }
        #endregion
    }
}
